package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

func main() {
	postBody, _ := json.Marshal(map[string]interface{}{
		"method": "HelloService.Hello",
		"params": []string{"wukun"},
		"id":     0,
	})
	rBody := bytes.NewBuffer(postBody)
	resp, err := http.Post("http://localhost:8080/jsonrpc", "application/json", rBody)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
